Optimal. Leaf size=91 \[ \frac {\sin (a-3 c+(b-3 d) x)}{8 (b-3 d)}+\frac {3 \sin (a-c+(b-d) x)}{8 (b-d)}+\frac {3 \sin (a+c+(b+d) x)}{8 (b+d)}+\frac {\sin (a+3 c+(b+3 d) x)}{8 (b+3 d)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {4666, 2717}
\begin {gather*} \frac {\sin (a+x (b-3 d)-3 c)}{8 (b-3 d)}+\frac {3 \sin (a+x (b-d)-c)}{8 (b-d)}+\frac {3 \sin (a+x (b+d)+c)}{8 (b+d)}+\frac {\sin (a+x (b+3 d)+3 c)}{8 (b+3 d)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 4666
Rubi steps
\begin {align*} \int \cos (a+b x) \cos ^3(c+d x) \, dx &=\int \left (\frac {1}{8} \cos (a-3 c+(b-3 d) x)+\frac {3}{8} \cos (a-c+(b-d) x)+\frac {3}{8} \cos (a+c+(b+d) x)+\frac {1}{8} \cos (a+3 c+(b+3 d) x)\right ) \, dx\\ &=\frac {1}{8} \int \cos (a-3 c+(b-3 d) x) \, dx+\frac {1}{8} \int \cos (a+3 c+(b+3 d) x) \, dx+\frac {3}{8} \int \cos (a-c+(b-d) x) \, dx+\frac {3}{8} \int \cos (a+c+(b+d) x) \, dx\\ &=\frac {\sin (a-3 c+(b-3 d) x)}{8 (b-3 d)}+\frac {3 \sin (a-c+(b-d) x)}{8 (b-d)}+\frac {3 \sin (a+c+(b+d) x)}{8 (b+d)}+\frac {\sin (a+3 c+(b+3 d) x)}{8 (b+3 d)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 85, normalized size = 0.93 \begin {gather*} \frac {1}{8} \left (\frac {\sin (a-3 c+b x-3 d x)}{b-3 d}+\frac {3 \sin (a-c+b x-d x)}{b-d}+\frac {\sin (a+3 c+b x+3 d x)}{b+3 d}+\frac {3 \sin (a+c+(b+d) x)}{b+d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 84, normalized size = 0.92
method | result | size |
default | \(\frac {\sin \left (a -3 c +\left (b -3 d \right ) x \right )}{8 b -24 d}+\frac {3 \sin \left (a -c +\left (b -d \right ) x \right )}{8 \left (b -d \right )}+\frac {3 \sin \left (a +c +\left (b +d \right ) x \right )}{8 \left (b +d \right )}+\frac {\sin \left (a +3 c +\left (b +3 d \right ) x \right )}{8 b +24 d}\) | \(84\) |
risch | \(\frac {\sin \left (b x -3 d x +a -3 c \right ) b}{8 \left (b -3 d \right ) \left (b +3 d \right )}+\frac {3 \sin \left (b x -3 d x +a -3 c \right ) d}{8 \left (b -3 d \right ) \left (b +3 d \right )}+\frac {3 \sin \left (b x -d x +a -c \right ) b}{8 \left (b -d \right ) \left (b +d \right )}+\frac {3 \sin \left (b x -d x +a -c \right ) d}{8 \left (b -d \right ) \left (b +d \right )}+\frac {3 \sin \left (b x +d x +a +c \right ) b}{8 \left (b -d \right ) \left (b +d \right )}-\frac {3 \sin \left (b x +d x +a +c \right ) d}{8 \left (b -d \right ) \left (b +d \right )}+\frac {\sin \left (b x +3 d x +a +3 c \right ) b}{8 \left (b -3 d \right ) \left (b +3 d \right )}-\frac {3 \sin \left (b x +3 d x +a +3 c \right ) d}{8 \left (b -3 d \right ) \left (b +3 d \right )}\) | \(228\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 914 vs.
\(2 (83) = 166\).
time = 0.34, size = 914, normalized size = 10.04 \begin {gather*} -\frac {{\left (b^{3} \sin \left (3 \, c\right ) - 3 \, b^{2} d \sin \left (3 \, c\right ) - b d^{2} \sin \left (3 \, c\right ) + 3 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left ({\left (b + 3 \, d\right )} x + a + 6 \, c\right ) - {\left (b^{3} \sin \left (3 \, c\right ) - 3 \, b^{2} d \sin \left (3 \, c\right ) - b d^{2} \sin \left (3 \, c\right ) + 3 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left ({\left (b + 3 \, d\right )} x + a\right ) + 3 \, {\left (b^{3} \sin \left (3 \, c\right ) - b^{2} d \sin \left (3 \, c\right ) - 9 \, b d^{2} \sin \left (3 \, c\right ) + 9 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left ({\left (b + d\right )} x + a + 4 \, c\right ) - 3 \, {\left (b^{3} \sin \left (3 \, c\right ) - b^{2} d \sin \left (3 \, c\right ) - 9 \, b d^{2} \sin \left (3 \, c\right ) + 9 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left ({\left (b + d\right )} x + a - 2 \, c\right ) - 3 \, {\left (b^{3} \sin \left (3 \, c\right ) + b^{2} d \sin \left (3 \, c\right ) - 9 \, b d^{2} \sin \left (3 \, c\right ) - 9 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left (-{\left (b - d\right )} x - a + 4 \, c\right ) + 3 \, {\left (b^{3} \sin \left (3 \, c\right ) + b^{2} d \sin \left (3 \, c\right ) - 9 \, b d^{2} \sin \left (3 \, c\right ) - 9 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left (-{\left (b - d\right )} x - a - 2 \, c\right ) - {\left (b^{3} \sin \left (3 \, c\right ) + 3 \, b^{2} d \sin \left (3 \, c\right ) - b d^{2} \sin \left (3 \, c\right ) - 3 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left (-{\left (b - 3 \, d\right )} x - a + 6 \, c\right ) + {\left (b^{3} \sin \left (3 \, c\right ) + 3 \, b^{2} d \sin \left (3 \, c\right ) - b d^{2} \sin \left (3 \, c\right ) - 3 \, d^{3} \sin \left (3 \, c\right )\right )} \cos \left (-{\left (b - 3 \, d\right )} x - a\right ) - {\left (b^{3} \cos \left (3 \, c\right ) - 3 \, b^{2} d \cos \left (3 \, c\right ) - b d^{2} \cos \left (3 \, c\right ) + 3 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left ({\left (b + 3 \, d\right )} x + a + 6 \, c\right ) - {\left (b^{3} \cos \left (3 \, c\right ) - 3 \, b^{2} d \cos \left (3 \, c\right ) - b d^{2} \cos \left (3 \, c\right ) + 3 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left ({\left (b + 3 \, d\right )} x + a\right ) - 3 \, {\left (b^{3} \cos \left (3 \, c\right ) - b^{2} d \cos \left (3 \, c\right ) - 9 \, b d^{2} \cos \left (3 \, c\right ) + 9 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left ({\left (b + d\right )} x + a + 4 \, c\right ) - 3 \, {\left (b^{3} \cos \left (3 \, c\right ) - b^{2} d \cos \left (3 \, c\right ) - 9 \, b d^{2} \cos \left (3 \, c\right ) + 9 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left ({\left (b + d\right )} x + a - 2 \, c\right ) + 3 \, {\left (b^{3} \cos \left (3 \, c\right ) + b^{2} d \cos \left (3 \, c\right ) - 9 \, b d^{2} \cos \left (3 \, c\right ) - 9 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left (-{\left (b - d\right )} x - a + 4 \, c\right ) + 3 \, {\left (b^{3} \cos \left (3 \, c\right ) + b^{2} d \cos \left (3 \, c\right ) - 9 \, b d^{2} \cos \left (3 \, c\right ) - 9 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left (-{\left (b - d\right )} x - a - 2 \, c\right ) + {\left (b^{3} \cos \left (3 \, c\right ) + 3 \, b^{2} d \cos \left (3 \, c\right ) - b d^{2} \cos \left (3 \, c\right ) - 3 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left (-{\left (b - 3 \, d\right )} x - a + 6 \, c\right ) + {\left (b^{3} \cos \left (3 \, c\right ) + 3 \, b^{2} d \cos \left (3 \, c\right ) - b d^{2} \cos \left (3 \, c\right ) - 3 \, d^{3} \cos \left (3 \, c\right )\right )} \sin \left (-{\left (b - 3 \, d\right )} x - a\right )}{16 \, {\left (b^{4} \cos \left (3 \, c\right )^{2} + b^{4} \sin \left (3 \, c\right )^{2} + 9 \, {\left (\cos \left (3 \, c\right )^{2} + \sin \left (3 \, c\right )^{2}\right )} d^{4} - 10 \, {\left (b^{2} \cos \left (3 \, c\right )^{2} + b^{2} \sin \left (3 \, c\right )^{2}\right )} d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.01, size = 109, normalized size = 1.20 \begin {gather*} -\frac {{\left (6 \, b d^{2} \cos \left (d x + c\right ) - {\left (b^{3} - b d^{2}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (b x + a\right ) - 3 \, {\left (2 \, d^{3} \cos \left (b x + a\right ) - {\left (b^{2} d - d^{3}\right )} \cos \left (b x + a\right ) \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{b^{4} - 10 \, b^{2} d^{2} + 9 \, d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 921 vs.
\(2 (76) = 152\).
time = 2.29, size = 921, normalized size = 10.12 \begin {gather*} \begin {cases} x \cos {\left (a \right )} \cos ^{3}{\left (c \right )} & \text {for}\: b = 0 \wedge d = 0 \\\frac {x \sin {\left (a - 3 d x \right )} \sin ^{3}{\left (c + d x \right )}}{8} - \frac {3 x \sin {\left (a - 3 d x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{8} - \frac {3 x \sin ^{2}{\left (c + d x \right )} \cos {\left (a - 3 d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {x \cos {\left (a - 3 d x \right )} \cos ^{3}{\left (c + d x \right )}}{8} - \frac {\sin {\left (a - 3 d x \right )} \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {7 \sin {\left (a - 3 d x \right )} \cos ^{3}{\left (c + d x \right )}}{24 d} - \frac {\sin ^{3}{\left (c + d x \right )} \cos {\left (a - 3 d x \right )}}{8 d} & \text {for}\: b = - 3 d \\- \frac {3 x \sin {\left (a - d x \right )} \sin ^{3}{\left (c + d x \right )}}{8} - \frac {3 x \sin {\left (a - d x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{8} + \frac {3 x \sin ^{2}{\left (c + d x \right )} \cos {\left (a - d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {3 x \cos {\left (a - d x \right )} \cos ^{3}{\left (c + d x \right )}}{8} - \frac {3 \sin {\left (a - d x \right )} \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {5 \sin {\left (a - d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {3 \sin ^{3}{\left (c + d x \right )} \cos {\left (a - d x \right )}}{8 d} & \text {for}\: b = - d \\\frac {3 x \sin {\left (a + d x \right )} \sin ^{3}{\left (c + d x \right )}}{8} + \frac {3 x \sin {\left (a + d x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{8} + \frac {3 x \sin ^{2}{\left (c + d x \right )} \cos {\left (a + d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {3 x \cos {\left (a + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8} + \frac {3 \sin {\left (a + d x \right )} \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {5 \sin {\left (a + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {3 \sin ^{3}{\left (c + d x \right )} \cos {\left (a + d x \right )}}{8 d} & \text {for}\: b = d \\- \frac {x \sin {\left (a + 3 d x \right )} \sin ^{3}{\left (c + d x \right )}}{8} + \frac {3 x \sin {\left (a + 3 d x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{8} - \frac {3 x \sin ^{2}{\left (c + d x \right )} \cos {\left (a + 3 d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {x \cos {\left (a + 3 d x \right )} \cos ^{3}{\left (c + d x \right )}}{8} + \frac {\sin {\left (a + 3 d x \right )} \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {7 \sin {\left (a + 3 d x \right )} \cos ^{3}{\left (c + d x \right )}}{24 d} - \frac {\sin ^{3}{\left (c + d x \right )} \cos {\left (a + 3 d x \right )}}{8 d} & \text {for}\: b = 3 d \\\frac {b^{3} \sin {\left (a + b x \right )} \cos ^{3}{\left (c + d x \right )}}{b^{4} - 10 b^{2} d^{2} + 9 d^{4}} - \frac {3 b^{2} d \sin {\left (c + d x \right )} \cos {\left (a + b x \right )} \cos ^{2}{\left (c + d x \right )}}{b^{4} - 10 b^{2} d^{2} + 9 d^{4}} - \frac {6 b d^{2} \sin {\left (a + b x \right )} \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{b^{4} - 10 b^{2} d^{2} + 9 d^{4}} - \frac {7 b d^{2} \sin {\left (a + b x \right )} \cos ^{3}{\left (c + d x \right )}}{b^{4} - 10 b^{2} d^{2} + 9 d^{4}} + \frac {6 d^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (a + b x \right )}}{b^{4} - 10 b^{2} d^{2} + 9 d^{4}} + \frac {9 d^{3} \sin {\left (c + d x \right )} \cos {\left (a + b x \right )} \cos ^{2}{\left (c + d x \right )}}{b^{4} - 10 b^{2} d^{2} + 9 d^{4}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.39, size = 84, normalized size = 0.92 \begin {gather*} \frac {\sin \left (b x + 3 \, d x + a + 3 \, c\right )}{8 \, {\left (b + 3 \, d\right )}} + \frac {3 \, \sin \left (b x + d x + a + c\right )}{8 \, {\left (b + d\right )}} + \frac {3 \, \sin \left (b x - d x + a - c\right )}{8 \, {\left (b - d\right )}} + \frac {\sin \left (b x - 3 \, d x + a - 3 \, c\right )}{8 \, {\left (b - 3 \, d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.95, size = 313, normalized size = 3.44 \begin {gather*} {\mathrm {e}}^{a\,1{}\mathrm {i}-c\,3{}\mathrm {i}+b\,x\,1{}\mathrm {i}-d\,x\,3{}\mathrm {i}}\,\left (\frac {b+3\,d}{b^2\,16{}\mathrm {i}-d^2\,144{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (b-3\,d\right )}{b^2\,16{}\mathrm {i}-d^2\,144{}\mathrm {i}}\right )+{\mathrm {e}}^{a\,1{}\mathrm {i}+c\,3{}\mathrm {i}+b\,x\,1{}\mathrm {i}+d\,x\,3{}\mathrm {i}}\,\left (\frac {b-3\,d}{b^2\,16{}\mathrm {i}-d^2\,144{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (b+3\,d\right )}{b^2\,16{}\mathrm {i}-d^2\,144{}\mathrm {i}}\right )+{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}-d\,x\,1{}\mathrm {i}}\,\left (\frac {3\,b+3\,d}{b^2\,16{}\mathrm {i}-d^2\,16{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (3\,b-3\,d\right )}{b^2\,16{}\mathrm {i}-d^2\,16{}\mathrm {i}}\right )+{\mathrm {e}}^{a\,1{}\mathrm {i}+c\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\left (\frac {3\,b-3\,d}{b^2\,16{}\mathrm {i}-d^2\,16{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (3\,b+3\,d\right )}{b^2\,16{}\mathrm {i}-d^2\,16{}\mathrm {i}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________